﻿package  Classes
{
	import Classes.LevelManagement.LevelManager;
	import Classes.Objects.*;
	import flash.display.MovieClip;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.ui.Keyboard;
	import flash.ui.Mouse;
	import Classes.LevelManagement.Levels.*;
	import Classes.Utils.Input;
	import flash.utils.Dictionary;
	/**
	 * ...
	 * @author Rodrigo Forti & Rafael Bringel
	 */
	public class Main extends MovieClip
	{
		private static var _instance:	Main = null;
		
		public static var _stringsMovieclipsDictionary:Dictionary;
		private var _listaMovieClips:Array;
	
		public var MC_tela:MovieClip;
		
		public function Main() 
		{
			_instance = this;
			//_listaMovieClips = [Indio, Monge];
			
			_stringsMovieclipsDictionary = new Dictionary();
			_stringsMovieclipsDictionary["lobo"] = MC_Lobo;
			_stringsMovieclipsDictionary["parede"] = MC_Parede;
			_stringsMovieclipsDictionary["inimigo"] = MC_Inimigo;
			
			MC_tela = new MovieClip();
			addChild(MC_tela);
			iniciar();
		}
		
		public static function getInstance():Main 
		{ 
			return _instance; 
		}
		
        public static function getStage():Stage 
		{
			return getInstance().stage; 
		}
		
		public function iniciar ():void
		{
			addEventListener (Event.ENTER_FRAME, update, false, 0, true);
			Mouse.show();
			
			LevelManager.current = new Level3();
			
			desenharTela();
		}


		public function desenharTela ():void
		{
			
		}
		
		public function update (e:Event):void
		{
			
			LevelManager.update();
			Input.onUpdate();
		}
		
	}

}